package net.huashitong.ssydt.provider.exam.service;


import net.huashitong.ssydt.exam.entity.SsExamTestSchedule;
import net.huashitong.ssydt.provider.exam.mapper.SsExamTestScheduleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.08.24
 */
@Service
@Transactional
public class SsExamTestScheduleServiceImpl implements SsExamTestScheduleService {

    private SsExamTestScheduleMapper ssExamTestScheduleMapper;

    @Autowired
    public SsExamTestScheduleServiceImpl(SsExamTestScheduleMapper ssExamTestScheduleMapper) {
        this.ssExamTestScheduleMapper = ssExamTestScheduleMapper;
    }

    @Override
    public SsExamTestSchedule getNotHistoryByUserId(String userId) {
        return ssExamTestScheduleMapper.getNotHistoryByUserId(userId);
    }

    @Override
    public void update(SsExamTestSchedule ssExamTestSchedule) {
        ssExamTestScheduleMapper.updateByPrimaryKey(ssExamTestSchedule);
    }

    @Override
    public void saveSelective(SsExamTestSchedule ssExamTestSchedule) {
        ssExamTestScheduleMapper.insertSelective(ssExamTestSchedule);
    }

    @Override
    public SsExamTestSchedule getById(Long id) {
        return ssExamTestScheduleMapper.selectByPrimaryKey(id);
    }
}
